package com.zang.singleton;

/**
 * 单线程单例
 *
 * @author Zhang Qiang
 * @Date 2019/9/20 11:21
 */
public class SingleThreadSingleton {
    private static SingleThreadSingleton instance = null;

    private SingleThreadSingleton(){
        System.out.println("创建SingleThreadSingleton");
    }

    public static SingleThreadSingleton getInstance(){
        if (instance == null){
            instance = new SingleThreadSingleton();
        }
        return instance;
    }


}
